package com.winexpress.product;

import com.winexpress.entity.Comment;
import com.winexpress.session.product.CommentSessionBean;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService(serviceName = "CommentManagementWS")
public class CommentManagementWS {

    @EJB
    CommentSessionBean commentSessionBean;

    @WebMethod(operationName = "getProductComment")
    public List<Comment> getProductComment(@WebParam(name = "wid") long wid) {
        return commentSessionBean.getProductComment(wid);
    }

    @WebMethod(operationName = "deleteComment")
    public void deleteComment(@WebParam(name = "commentID") long commentID) {
        commentSessionBean.deleteComment(commentID);
    }

    @WebMethod(operationName = "addComment")
    public Long addComment(@WebParam(name = "inComment") Comment inComment) {
        return commentSessionBean.createComment(inComment);
    }
}
